package core.form;

import java.lang.reflect.Field;

import javax.servlet.http.HttpServletRequest;

public class FullForm {

   public FullForm(){
		
	}
   public static ActionForm full(String formPath,HttpServletRequest request){
	   
	   ActionForm form = null;
	   try {
		Class cla = Class.forName(formPath);
		form = (ActionForm) cla.newInstance();
		Field [] field_1=cla.getDeclaredFields();
		for (Field field : field_1) {
			field.setAccessible(true);
			field.set(form, request.getParameter(field.getName()));
			field.setAccessible(false);
		}
	} catch (Exception e) {
		System.out.println(e.getStackTrace()+"：bean装载form失败");
	}
	   
	return form;
	   
   }
}
